<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>编辑文章</title>
    <script type='text/javascript' src='http://localhost/cms/hdphp/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>
<link href='http://localhost/cms/hdphp/hdphp/../hdjs/css/hdjs.css' rel='stylesheet' media='screen'>
<script src='http://localhost/cms/hdphp/hdphp/../hdjs/js/hdjs.js'></script>
<script src='http://localhost/cms/hdphp/hdphp/../hdjs/js/slide.js'></script>
<script src='http://localhost/cms/hdphp/hdphp/../hdjs/org/cal/lhgcalendar.min.js'></script>
<script type='text/javascript'>
HOST = '<?php echo $GLOBALS['user']['HOST'];?>';
ROOT = '<?php echo $GLOBALS['user']['ROOT'];?>';
WEB = '<?php echo $GLOBALS['user']['WEB'];?>';
URL = '<?php echo $GLOBALS['user']['URL'];?>';
HDPHP = '<?php echo $GLOBALS['user']['HDPHP'];?>';
HDPHPDATA = '<?php echo $GLOBALS['user']['HDPHPDATA'];?>';
HDPHPTPL = '<?php echo $GLOBALS['user']['HDPHPTPL'];?>';
HDPHPEXTEND = '<?php echo $GLOBALS['user']['HDPHPEXTEND'];?>';
APP = '<?php echo $GLOBALS['user']['APP'];?>';
CONTROL = '<?php echo $GLOBALS['user']['CONTROL'];?>';
METH = '<?php echo $GLOBALS['user']['METH'];?>';
GROUP = '<?php echo $GLOBALS['user']['GROUP'];?>';
TPL = '<?php echo $GLOBALS['user']['TPL'];?>';
CONTROLTPL = '<?php echo $GLOBALS['user']['CONTROLTPL'];?>';
STATIC = '<?php echo $GLOBALS['user']['STATIC'];?>';
PUBLIC = '<?php echo $GLOBALS['user']['PUBLIC'];?>';
HISTORY = '<?php echo $GLOBALS['user']['HISTORY'];?>';
HTTPREFERER = '<?php echo $GLOBALS['user']['HTTPREFERER'];?>';
</script>
    <link href='http://localhost/cms/hdphp/hdphp/Extend/Org/bootstrap/css/bootstrap.min.css' rel='stylesheet' media='screen'>
<script src='http://localhost/cms/hdphp/hdphp/Extend/Org/bootstrap/js/bootstrap.min.js'></script>
                <!--[if lte IE 6]>
                <link rel="stylesheet" type="text/css" href="http://localhost/cms/hdphp/hdphp/Extend/Org/bootstrap/ie6/css/bootstrap-ie6.css">
                <![endif]-->
                <!--[if lt IE 9]>
                <script src="http://localhost/cms/hdphp/hdphp/Extend/Org/bootstrap/js/html5shiv.min.js"></script>
                <script src="http://localhost/cms/hdphp/hdphp/Extend/Org/bootstrap/js/respond.min.js"></script>
                <![endif]-->
    <link type="text/css" rel="stylesheet" href="http://localhost/cms/./Cms/Cms/Admin/Tpl/Article/css/css.css"/>
    <script type="text/javascript" src="http://localhost/cms/./Cms/Cms/Admin/Tpl/Public/yz.js"></script>
    <style type="text/css">
        .checkbox{
             margin-left:5px;
             width:90px;
             margin-top: 10px;
        }
        textarea{
            width: 300px;
            height: 100px;
        }
        .slt{ position: relative; width: 200px;}
        .slt span{ position: absolute; top: 5px; right: 5px; display: block; background:#F00; width:15px; height: 15px; text-align: center;}

    </style>
    <script type="text/javascript">
        $(function(){
            var src = $('.shanchu').attr('src');
            var aid = $('.shanchu').attr('aid');

           $('.close').click(function(){
                $.ajax({
                    url : 'http://localhost/cms/index.php/Admin/Article' + '/del_img',
                    type : 'post',
                    data : {'is_del' : src,'aid' : aid},
                    dataType : 'text',
                    success:function(data){
                        if (data) {
                            $('.slt').css({display:'none'});
                            alert('删除成功');
                        };
                    },
                    erroe:function(){
                        alert('error');
                    }
                })
           })
        })
    </script>
</head>
<body>
<div class="wrap">
    <div class="title-header">编辑文章</div>
    <form action="" method="post" class="form-inline hd-form" enctype="multipart/form-data">
        <table class="table1">
            <tr>
                <th class="w100">文章标题</th>
                <td class="w100">
                    <input type="text" name="title" class="w200" value="<?php echo $oldArc['title'];?>"/> 
                    <span id="hd_title"></span>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">作者</th>
                <td>
                    <input type="text" name="author" class="w200" value="<?php echo $_SESSION['adminname'];?>"/>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">所属分类</th>
                <td>
                    <select name="category_cid" class="w200">
                        <option value="-1">请选择分类</option>
                        <?php if(is_array($cate)):?><?php  foreach($cate as $v){ ?>
                            <option value="<?php echo $v['cid'];?>" <?php if($v['cid'] == $oldArc['category_cid']){?>selected="selected"<?php }?>><?php echo $v['_name'];?></option>
                        <?php }?><?php endif;?>
                    </select>
                </td>
                <td><span id="ha_category_cid"></span></td>
            </tr>
            <tr>
                <th class="w100">文章摘要</th>
                <td>
                    <textarea name="digest"><?php echo $oldArc['digest'];?></textarea>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">缩略图</th>
                <td>
                     <input type="file" name="thumb" id="" />
                     <div class="slt">
                        <?php if($oldArc['thumb'] == 'http://localhost/cms/'){?>
                            暂无缩略图
                        <?php  }else{ ?>
                            <span class="close">X</span>
                            <img src="<?php echo $oldArc['thumb'];?>" width="200" class="shanchu" aid="<?php echo $oldArc['aid'];?>" />
                        <?php }?>
                    </div>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">文章属性</th>
                <td>
                    <label class="checkbox-inline">
                        热门
                        <input type="checkbox" value="热门" name="attr[]" class="check_input" <?php if(in_array('热门',$oldArc['attr'])){?>checked="checked"<?php }?>>
                    </label>
                    <label class="checkbox-inline">
                        置顶
                        <input type="checkbox" value="置顶" name="attr[]" class="check_input" <?php if(in_array('置顶',$oldArc['attr'])){?>checked="checked"<?php }?>>
                    </label>
                    <label class="checkbox-inline">
                        推荐
                        <input type="checkbox" value="推荐" name="attr[]" class="check_input" <?php if(in_array('推荐',$oldArc['attr'])){?>checked="checked"<?php }?>>
                    </label>
                    <label class="checkbox-inline">
                        图文
                        <input type="checkbox" value="图文" name="attr[]" class="check_input" <?php if(in_array('图文',$oldArc['attr'])){?>checked="checked"<?php }?>>
                    </label>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">文章标签</th>
                <td>
                    <?php if(is_array($tag)):?><?php  foreach($tag as $v){ ?>
                    <label class="checkbox-inline">
                        <?php echo $v['tagname'];?>
                        <input type="checkbox" value="<?php echo $v['tid'];?>" name="tag[]" class="check_input" <?php if(in_array($v["tid"],$tempTag)){?>checked="checked"<?php }?>>
                    </label>
                    <?php }?><?php endif;?>
                </td>
                <td></td>
            </tr>
             <tr>
                <th class="w100">文章关键字</th>
                <td>
                    <textarea name="keywords" id="" rows="10"><?php echo $oldData['keywords'];?></textarea>
                    <span id="hd_keywors"></span>
                </td>
                <td></td>
            </tr>
             <tr>
                <th class="w100">文章描述</th>
                <td>
                    <textarea name="description" id="" cols="30" rows="10"><?php echo $oldData['description'];?></textarea>
                    <span id="hd_description"></span>
                </td>
                <td></td>
            </tr>
             <tr>
                <th class="w100">文章正文</th>
                <td>
                    <script type="text/javascript" charset="utf-8" src="http://localhost/cms/hdphp/hdphp/Extend/Org/Ueditor/ueditor.config.js"></script><script type="text/javascript" charset="utf-8" src="http://localhost/cms/hdphp/hdphp/Extend/Org/Ueditor/ueditor.all.min.js"></script><script type="text/javascript">UEDITOR_HOME_URL="http://localhost/cms/hdphp/hdphp/Extend/Org/Ueditor/"</script><script id="hd_content" name="content" type="text/plain"><?php echo $oldData['content'];?></script>
        <script type='text/javascript'>
        $(function(){
                var ue = UE.getEditor('hd_content',{
                imageUrl:'http://localhost/cms/index.php?a=Admin&c=Article&aid=89&m=ueditor_upload&g=Cms&water=0&uploadsize=2000000&maximagewidth=false&maximageheight=false'//处理上传脚本
                ,zIndex : 0
                ,autoClearinitialContent:false
                ,initialFrameWidth:"800" //宽度1000
                ,initialFrameHeight:"300" //宽度1000
                ,autoHeightEnabled:false //是否自动长高,默认true
                ,autoFloatEnabled:false //是否保持toolbar的位置不动,默认true
                ,maximumWords:2000 //允许的最大字符数
                ,readonly : false //编辑器初始化结束后,编辑区域是否是只读的，默认是false
                ,wordCount:true //是否开启字数统计
                ,imagePath:''//图片修正地址
                , toolbars:[
            ['fullscreen', 'source', '|', 'undo', 'redo', '|',
                'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
                'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
                'directionalityltr', 'directionalityrtl', 'indent', '|',
                'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
                'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
                'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe','insertcode', 'pagebreak', 'template', 'background', '|',
                'horizontal', 'date', 'time', 'spechars',  'wordimage', '|',
                'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
                'print', 'preview', 'searchreplace']
            ]//工具按钮
                , initialStyle:'p{line-height:1em; font-size: 14px; }'
            });
        })
        </script> 
                </td>
                <td class="yz_con"></td>
            </tr>
            <tr>
                <th class="w100"></th>
                <td></td>
                <td></td>
            </tr>
            <tr>
                <th class="w100"></th>
                <td></td>
                <td></td>
            </tr>
        
        </table>
        <div class="position-bottom">
            <input type="hidden" name="aid" value="<?php echo $_GET['aid'];?>"/>
            <input type="submit" class="hd-success" value="修改"/>
        </div>
    </form>
</div>
</body>
</html>